package com.dlc.shop.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dlc.shop.bean.model.CompanyAuditing;
import com.dlc.shop.bean.model.ShopCompany;
import com.dlc.shop.bean.param.CompanyInfoAuditParam;

import java.util.List;

/**
 * @author chiley
 * @date 2022/9/21 10:32
 */
public interface CompanyAuditingService extends IService<CompanyAuditing> {

    /**
     * 商家申请变更工商信息
     *
     * @param shopCompany
     * @param userId 申请用户Id
     */
    void applyChangeCompanyInfo(ShopCompany shopCompany, String userId);

    /**
     * 撤销申请
     *
     * @param companyAuditing 申请记录
     */
    void revoke(CompanyAuditing companyAuditing);

    /**
     * 分页获取待审核的签约信息列表
     * @param page
     * @param companyInfoAuditParam 搜索参数
     * @return
     */
    IPage<CompanyAuditing> page(Page<CompanyAuditing> page, CompanyInfoAuditParam companyInfoAuditParam);

    /**
     * 审核店铺工商信息
     * @param companyAuditing
     */
    void audit(CompanyAuditing companyAuditing);

    /**
     * 获取工商信息审核信息
     * @param shopId
     * @return
     */
    CompanyAuditing getAuditInfo(Long shopId);

    /**
     * 根据店铺id获取最近一条工商审核信息
     *
     * @param shopId
     * @return
     */
    CompanyAuditing getLatestAuditingByShopId(Long shopId);

    /**
     * 企业信息更新回调
     * @param bizUserId
     * @param status
     * @param result
     * @param failReason
     */
    void updateCompanyInfoResult(String bizUserId, Integer status, Integer result, String failReason);

    /**
     * 回调更新通联状态
     * @param bizUserId
     * @param status
     * @param failReason
     */
    void updateAllinpayShopStatus(String bizUserId, Integer status, String failReason);

    /**
     * 更新备注
     * @param companyAuditing
     */
    void updateRemark(CompanyAuditing companyAuditing);

    /**
     * 获取需要审核的信息
     * @return
     */
    List<CompanyAuditing> getNeedAuditList();
}
